package edu.gmu.cs795;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class HeartbeatSimulatorActivity extends Activity {
	private EditText text;

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
		text = (EditText) findViewById(R.id.editText1);
   }
    
	// This method is called at button click because we assigned the name to the
	// "On Click property" of the button
	public void myClickHandler(View view) {
		switch (view.getId()) {
		case R.id.button1:
			if (text.getText().length() == 0) {
				Toast.makeText(this, "Please enter a valid number",
						Toast.LENGTH_LONG *100).show();
				return;
			}

			text.setText(text.getText().toString());
			Toast.makeText(this, text.getText().toString(),
					Toast.LENGTH_LONG).show();
			break;
		}
	}

}